package com.candy.oop2;

/**
 * 所有类都直接或间接继承自Object类，即使没有显示使用extends
 */
public class Fruit {
//    受访问控制修饰符的限制，使用private修饰的变量是不能被子类继承的
    String type="水果";
    private double price;
    String area;

//    public Fruit() {
//        System.out.println("我是父类的构造方法");
//    }

    public Fruit(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public void getInfomation(){

        System.out.println("我是水果");
    }
}
